package com.train.mgr.modules.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.train.mgr.modules.biz.dto.TraineeCourseDetailVo;
import com.train.mgr.modules.biz.dto.TraineeCourseHomeVo;
import com.train.mgr.modules.biz.dto.TraineeCourseUserGroupVo;
import com.train.mgr.modules.biz.dto.TraineeLessonFinishSituationVo;
import com.train.mgr.modules.biz.dto.request.NoGroupQueryReqDTO;
import com.train.mgr.modules.biz.dto.request.TraineeCoursePageDTO;
import com.train.mgr.modules.biz.dto.response.CourseCheckUserRespListDTO;
import com.train.mgr.modules.biz.dto.response.CourseUserRespListDTO;
import com.train.mgr.modules.biz.dto.response.NotJoinGroupUserRespListDTO;
import com.train.mgr.modules.biz.entity.CourseUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程学员表 Mapper 接口
 * </p>
 *
 * @author cxg
 * @date 2025-09-30
 */
public interface CourseUserMapper extends BaseMapper<CourseUser> {

    Page<TraineeCourseDetailVo> getMyCourse(Page<TraineeCourseDetailVo> page, @Param("query") TraineeCoursePageDTO query, @Param("userId")  Long userId, @Param("customerId")  Long customerId);

    Integer checkJoinCourseState(@Param("courseId") Long courseId,@Param("userId") Long userId,  @Param("customerId") Long customerId);

    List<TraineeCourseUserGroupVo> getUserGroupList(@Param("courseId") Long courseId);
    List<TraineeCourseHomeVo> getUserCourse(@Param("courseId") Long courseId, @Param("customerId") Long customerId);

    List<TraineeCourseHomeVo> getUserJoinCourse(@Param("userId") Long userId,@Param("courseId") Long courseId, @Param("customerId") Long customerId);

    List<TraineeCourseHomeVo> getTraineeCourseUser(@Param("userId") Long userId,@Param("courseId") Long courseId, @Param("customerId") Long customerId);

    List<TraineeLessonFinishSituationVo> getLessonFinishSituation(@Param("userId") Long userId, @Param("courseId") Long courseId, @Param("customerId") Long customerId);

    int delByCoursId(@Param("courseId") Long courseId);

    Page<CourseUserRespListDTO> selectCourseUserList(Page<CourseUserRespListDTO> page, @Param("courseId") Long courseId,@Param("groupId") Long groupId,@Param("q") String q);

    Page<CourseCheckUserRespListDTO> selectCheckCourseUserList(Page<CourseCheckUserRespListDTO> page, @Param("courseId") Long courseId, @Param("customerId") Long customerId);

    Page<NotJoinGroupUserRespListDTO> selectNotGroupUserList(Page<NotJoinGroupUserRespListDTO> page, @Param("param") NoGroupQueryReqDTO param);
}
